// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   excel_locate_getpara.java

package manufacture.export;

import include.excel_export.Masking;
import include.excel_export.Solid;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class excel_locate_getpara extends HttpServlet
{

	public excel_locate_getpara()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		javax.servlet.ServletContext dbApplication = dbSession.getServletContext();
		HttpSession session = request.getSession();
		Masking mask = new Masking("xml/manufacture/data_excel.xml");
		Solid writer = new Solid("xml/manufacture/excel_export.xml");
		try
		{
			String timea = request.getParameter("timea");
			String timeb = request.getParameter("timeb");
			String manufacture_ID = request.getParameter("manufacture_ID");
			String keyword = request.getParameter("keyword");
			if (timea == null)
				timea = "";
			if (timeb == null)
				timeb = "";
			if (manufacture_ID == null)
				manufacture_ID = "";
			if (keyword == null)
				keyword = "";
			session.setAttribute("timea", timea);
			session.setAttribute("timeb", timeb);
			session.setAttribute("manufacture_ID", manufacture_ID);
			session.setAttribute("keyword", keyword);
			String tablenick = request.getParameter("tablenick");
			session.setAttribute("table", tablenick);
			String tablename = mask.getTableNameFormNick(tablenick);
			String cols[] = request.getParameterValues("col");
			if (cols == null)
			{
				response.sendRedirect((new StringBuilder("manufacture/export/excel_locate_getpara_a.jsp?tablenick=")).append(tablenick).toString());
			} else
			{
				String colsName[] = new String[cols.length];
				for (int i = 0; i < cols.length; i++)
					colsName[i] = mask.getColumnName(tablenick, cols[i]);

				writer.update(tablename, tablenick, colsName, cols);
				response.sendRedirect("manufacture_export_excel_ok");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
